<template>
  <view class="bd">
    <view class="dbox">
      <u-section :title="name" :right="false" class="tops"></u-section>
      <u-alert-tips
        type="primary"
        :description="description"
        class="text"
      ></u-alert-tips>
    </view>
    <view class="dbox">
      <u-section title="反馈结果" :right="false" class="tops"></u-section>
      <u-alert-tips
        type="error"
        :description="context || '暂无结果'"
        class="text"
      ></u-alert-tips>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      list: [],
      id: "", //进入详情的id
      description: "",
      name: "", //用户名
      context: "",
    };
  },
  onLoad(options) {
    this.id = options.id;
    this.getFamilyList();
  },
  onReady() {
    // this.getUiStyle();
  },
  methods: {
    getUiStyle() {
      var style = plus.navigator.getUiStyle();
      if ("dark" == style) {
        console.log("当前为暗黑模式");
        uni.setTabBarStyle({
          backgroundColor: "#1B1C1E",
        });
        uni.setNavigationBarColor({
          frontColor: "#ffffff",
          backgroundColor: "#1B1C1E",
          animation: {
            duration: 400,
            timingFunc: "easeIn",
          },
        });
      } else {
        console.log("当前为普通模式");
      }
    },
    // 获取家庭组列表
    getFamilyList() {
      let self = this;
      uni.showLoading({
        title: "加载中",
        mask: true,
      });
      setTimeout((s) => {
        uni.hideLoading();
      }, 5000);
      this.config
        .post("/feedbackData/getOne", {
          id: this.id,
        })
        .then((res) => {
          uni.hideLoading();
          //console.log(res)
          if (res.data.code === 200) {
            let datas = res.data.data;
            this.description = datas.content;
            this.name = datas.userName;
            this.context = datas.handleContent;
          } else {
            if (res.data.code == "-201") {
              self.config.handleError(res.data);
            } else {
              uni.showToast({
                title: self.config.handleError(res.data),
                icon: "none",
              });
            }
          }
        });
    },
  },
};
</script>

<style lang="less" scoped>
.dbox {
  padding: 30rpx;
  .tops {
    margin-bottom: 20rpx;
  }
  .text {
    text-indent: 2em;
    line-height: 52rpx;
    word-break: break-all;
  }
}
</style>
<style scoped>
@media (prefers-color-scheme: closedark) {
  .bd {
    height: calc(100vh - var(--window-top));
    background-color: #1b1c1e !important;
  }
  .bd1 {
    background-color: #1b1c1e !important;
  }
  .t1 {
    color: #ccc !important;
  }
}
</style>